import SrccessPath from './success.mp3'
import ErrorPath from './error.mp3'
import WaterPath from './water.mp3'
import RingPath from './ringring.mp3'
import PapaPath from './papa.mp3'
import DingdingPath from './dingding.mp3'
class AudioClass {
  constructor(path) {
    let _Audio = new Audio()
    _Audio.loop = false
    _Audio.src = path
    this.instances = _Audio
  }
  play() {
    this.instances.load()
    this.instances.play()
  }
}

export const playSuccess = () => {
  let ac = new AudioClass(SrccessPath)
  ac.play()
  ac = null
}
export const playError = () => {
  let ac = new AudioClass(ErrorPath)
  ac.play()
  ac = null
}

export const playWater = () => {
  let ac = new AudioClass(WaterPath)
  ac.play()
  ac = null
}
export const playRing = () => {
  let ac = new AudioClass(RingPath)
  ac.play()
  ac = null
}
export const playPapa = () => {
  let ac = new AudioClass(PapaPath)
  ac.play()
  ac = null
}
export const playDingding = () => {
  let ac = new AudioClass(DingdingPath)
  ac.play()
  ac = null
}
